import { commonUtil } from "../../utils/index.js";
import * as COMMON_CONFIG from "../commonConifg.js"

let MAX_INPUT_PER_DATE, LOGIN_RETRY_TIME, URL, DICT, STATUS, USERS, CONFIG;
try {
  CONFIG = commonUtil.getYamlConfig({
    fileName: "config.yaml",
    folderPath: "config/panyu_jiwei/",
  });
  DICT = commonUtil.getYamlConfig({
    fileName: "dict.yaml",
    folderPath: "config/panyu_jiwei/",
  });
  USERS = commonUtil.getYamlConfig({
    fileName: "users.yaml",
    folderPath: "config/panyu_jiwei/",
  });
  ({ URL } = CONFIG);
  ({ MAX_INPUT_PER_DATE, LOGIN_RETRY_TIME, STATUS } = COMMON_CONFIG);
} catch (e) {
  console.log('配置获取失败，请联系开发者获取用户配置')
  process.exit(1)
}

export { MAX_INPUT_PER_DATE, LOGIN_RETRY_TIME, URL, DICT, STATUS, USERS, CONFIG };

// export const LOGIN_RETRY_TIME = 5; // 登录重试
// export const URL = {
//   BASE_URL: "http://t3.3pigcn.com/pyjw", // 基卫地址
//   LOGIN: "/Frame/AspCode/ZhuChengXu/Login.aspx",
//   CAPTCHA: "/Frame/AspCode/ZhuChengXu/AuthenImage.aspx",
//   SET_JIGOU_KESHI: "/Frame/AspCode/ZhuChengXu/ShowSelect.aspx",
//
//   BASE_PARAM:
//     "/HR_Chronic/AspCode/AnnualExaminationManage/AnnualCheckList/AnnualExaminationRegister.aspx",
//   BASE_PARAM1: "/HyControl/ChooseDangan.aspx?pi=0.6088581111560587",
//   ANNUAL_CHECK_EXISTED: "/HyControl/ChooseDangan.aspx",
//   ANNUAL_LIST:
//     "/HR_Chronic/AspCode/AnnualExaminationManage/AnnualCheckList/AnnualExaminationRegister.aspx",
//   ANNUAL:
//     "/HR_Chronic/AspCode/AnnualExaminationManage/JianKangTiJianGuid/Default.aspx",
// };
//
// export const CRAWL_TWO_DICT = {
//   IDNum: "身份证号码",
//   name: "姓名",
//   ALT: "血清谷草转氨酶（U/L）",
//   TBIL: "总胆红素（μmol/L)",
//   STATUS: "状态",
//   NOTE: "备注",
// };
//
// export const STATUS = {
//   UNDO: "未录入",
//   ASSIGNED: "已分配",
//   EXISTED: "已存在",
//   FINISH: "已完成",
//   NOT_BUILD: "未建档",
//   WRONG: "错误",
// };

// const { LOGIN_RETRY, URL } = config;
// export { LOGIN_RETRY, URL };
